import React, { Component } from 'react';
import { connect } from 'dva';
import styles from './index.less';

@connect(({ opwarning }) => ({
  detailInfo: opwarning.detailInfo,
}))
export default class DetailBlock extends Component {
  constructor(props) {
    super(props);
  }
  componentDidMount() {
    const { dispatch } = this.props;
    console.log(dispatch);
    dispatch({
      type: 'opwarning/getDetailInfo',
      payload: {
        id: '4719024_28_10008',
        api_type: 'wealth_knows',
      },
    });
  }

  render() {
    let { detailInfo, dispatch } = this.props;
    dispatch({
      type: 'opwarning/getDetailInfo',
      payload: {
        id: '4719024_28_10008',
        api_type: 'wealth_knows',
      },
    });

    return (
      <div className={styles.detailMask}>
        <div className={styles.detailWrapper}>
          {this.props.id}
          {this.props.type}
        </div>
      </div>
    );
  }
}
